/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package ecom.entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 * @author simon
 */
@Entity
@Table(name = "purchases")
public class Purchase implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    private int idPurchase;
    private int quantity;
    private Double unitPrice;
    private Product product;
    private Orders orders;

    public Purchase() {
    }

    public int getIdPurchase() {
        return idPurchase;
    }

    public void setIdPurchase(int idPurchase) {
        this.idPurchase = idPurchase;
    }
   
    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public Double getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(Double unitPrice) {
        this.unitPrice = unitPrice;
    }

    public Product getProduct() {
        return product;
    }

    public void setProduct(Product product) {
        this.product = product;
    }

    public Orders getOrders() {
        return orders;
    }

    public void setOrders(Orders orders) {
        this.orders = orders;
    }

    
    
    @Override
    public String toString() {
        return "ecom.entity.Purchase[purchasePK=" + idPurchase + "\n"
                + "nameProduct=" + product.getName() + "\n"
                + "quantity=" + quantity + "\n"
                + "unit_price=" + unitPrice + "\n"
                + "]";
    }

}
